const express = require("express")
const router = express.Router()
const Doctor = require("../models/Doctor")

// 获取推荐医生列表
router.get("/getDoctorList", async (req, res) => {
  try {
    const doctors = await Doctor.find().sort({ createdAt: -1 })
    res.json(doctors)
  } catch (err) {
    res.status(500).json({ error: "获取数据失败" })
  }
})

module.exports = router
